7744c384526852a5240c32f15e2987a678f08269,controllersvc/src/main/java/com/emc/storageos/fileorchestrationcontroller/FileOrchestrationDeviceController.java,FileOrchestrationDeviceController,assignFileSnapshotPolicyToProjects,#Map#List#URI#String#,1923

Before Change


                                                        storageSystemURI);
                                        Object[] args = new Object[] { storageSystemURI, vNASURI, filePolicyToAssign, vpoolURI,
                                                projectURI };
                                        waitFor = _fileDeviceController.createMethod(workflow, waitFor,
                                                ASSIGN_FILE_SNAPSHOT_POLICY_TO_PROJECTS_METHOD,
                                                stepId,
                                                stepDes,
                                                storageSystemURI, args);
                                    }
                                }

                                StorageSystem storagesystem = s_dbClient.queryObject(StorageSystem.class, storageSystemURI);

                                // Create policy, if physical nas is eligible for provisioning!!
                                if (storagesystem.getSystemType().equals(Type.isilon.toString())) {

                                    if (usePhysicalNAS) {
                                        s_logger.info(
                                                "Generating step for assigning file policy {} to project on physical NAS server: {}.",
                                                filePolicyToAssign, vpoolURI);
                                        String stepId = workflow.createStepId();
                                        String stepDes = String
                                                .format("Assigning file policy: %s, to project: %s on storage system: %s",
                                                        filePolicy.getId(),
                                                        projectURI,
                                                        storageSystemURI);
                                        Object[] args = new Object[] { storageSystemURI, null, filePolicyToAssign, vpoolURI, projectURI };
                                        waitFor = _fileDeviceController.createMethod(workflow, waitFor,
                                                ASSIGN_FILE_SNAPSHOT_POLICY_TO_PROJECTS_METHOD,
                                                stepId,
                                                stepDes,
                                                storageSystemURI, args);

                                    }
                                }

After Change


        try {
            String waitFor = null;
            Workflow workflow = _workflowService.getNewWorkflow(this, ASSIGN_FILE_POLICY_WF_NAME, false, taskId, completer);
            completer.setWorkFlowId(workflow.getWorkflowURI());

            String usePhysicalNASForProvisioning = customConfigHandler.getComputedCustomConfigValue(
                    CustomConfigConstants.USE_PHYSICAL_NAS_FOR_PROVISIONING, "isilon", null);
            Boolean usePhysicalNAS = Boolean.valueOf(usePhysicalNASForProvisioning);

            for (URI vpoolURI : vpoolToStorageSystemMap.keySet()) {
                s_logger.info("Generating steps for assigning file policy {} to project: {}.", filePolicyToAssign, vpoolURI);
                List<URI> storageSystemURIList = vpoolToStorageSystemMap.get(vpoolURI);
                if (storageSystemURIList != null && !storageSystemURIList.isEmpty()) {
                    for (URI storageSystemURI : storageSystemURIList) {

                        if (projectURIs != null && !projectURIs.isEmpty()) {

                            for (URI projectURI : projectURIs) {
                                // Get the eligible nas server for given project from the storage system!!!
                                List<URI> vNASURIList = FileOrchestrationUtils.getVNASServersOfStorageSystemAndVarrayOfVpool(s_dbClient,
                                        storageSystemURI, vpoolURI, projectURI);
                                if (vNASURIList != null && !vNASURIList.isEmpty()) {
                                    for (URI vNASURI : vNASURIList) {
                                        String stepId = workflow.createStepId();
                                        String stepDes = String
                                                .format("Assigning file policy: %s, to project: %s on storage system: %s",
                                                        filePolicy.getId(),
                                                        vpoolURI,
                                                        storageSystemURI);
                                        Object[] args = new Object[] { storageSystemURI, vNASURI, filePolicyToAssign, vpoolURI,
                                                projectURI };
                                        // Let the all workflow steps be executed
                                        // workflow completer should handle the unsuccessful steps
                                        _fileDeviceController.createMethod(workflow, waitFor,
                                                ASSIGN_FILE_SNAPSHOT_POLICY_TO_PROJECTS_METHOD,
                                                stepId,
                                                stepDes,
                                                storageSystemURI, args);
                                    }
                                }

                                StorageSystem storagesystem = s_dbClient.queryObject(StorageSystem.class, storageSystemURI);

                                // Create policy, if physical nas is eligible for provisioning!!
                                if (storagesystem.getSystemType().equals(Type.isilon.toString())) {

                                    if (usePhysicalNAS) {
                                        s_logger.info(
                                                "Generating step for assigning file policy {} to project on physical NAS server: {}.",
                                                filePolicyToAssign, vpoolURI);
                                        String stepId = workflow.createStepId();
                                        String stepDes = String
                                                .format("Assigning file policy: %s, to project: %s on storage system: %s",
                                                        filePolicy.getId(),
                                                        projectURI,
                                                        storageSystemURI);
                                        Object[] args = new Object[] { storageSystemURI, null, filePolicyToAssign, vpoolURI, projectURI };
                                        // Let the all workflow steps be executed
                                        // workflow completer should handle the unsuccessful steps
                                        _fileDeviceController.createMethod(workflow, waitFor,
                                                ASSIGN_FILE_SNAPSHOT_POLICY_TO_PROJECTS_METHOD,
                                                stepId,
                                                stepDes,
                                                storageSystemURI, args);

                                    }
                                }